﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Test;
using ORMAC.Core;
using System.Diagnostics;

namespace ORMAC.Console
{
    class Program
    {
        static IReader orm ;
        static void Main(string[] args)
        {
            string TestDataCnn = "Server=.\\SQLExpress;Database=Northwind; Trusted_Connection=Yes";
            orm = new OReader();
            orm.SetConnectionString(TestDataCnn);
            orm.LoadObject<OOrders>(o => null);
            var res = orm.LoadFromDatabase<OOrders>();
            Test();
        }
        static void Test()
        {
            PerformanceCounters.ContextTime = 0;
            Stopwatch s = new Stopwatch();
            s.Start();
            var res = orm.LoadFromDatabase<OOrders>();
            s.Stop();
            System.Console.WriteLine(s.ElapsedMilliseconds.ToString());
            System.Console.WriteLine(PerformanceCounters.ContextTime.ToString());
            System.Console.ReadKey();
        }
    }
}
